<?php
$this->breadcrumbs=array();

$this->sidebarTop = array(
    'label' => Yii::t('BackEnd', "Menu item"),
    'link' => Yii::app()->createUrl('menuItem/index', array('mId'=>$model->menu_id))
);
//Declare icons
$iconManager = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/18_12x12.png" class="icon" />&nbsp;';
$iconCreate = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/create_12x12.png" class="icon" />&nbsp;';
$iconDelete = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/delete_12x12.png" class="icon" />&nbsp;';
$iconList = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/12_12x12.png" class="icon" />&nbsp;';
$iconTitle = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/1_16x16.png" class="icon" />&nbsp;';
$iconUpdate = '<img src="'.Yii::app()->request->baseUrl.'/css/admin/images/icons/edit_12x12.png" class="icon" />&nbsp;';

$this->menu=array(
    array('label'=>$iconCreate.Yii::t('BackEnd', 'Create'), 'url'=>array('create', 'mId'=>$model->menu_id), 'visible'=>UserAccess::checkAccess('menuItemCreate')),
	array('label'=>$iconUpdate.Yii::t('BackEnd', 'Update'), 'url'=>array('update', 'id'=>$model->id), 'visible'=>UserAccess::checkAccess('menuItemUpdate')),
	array('label'=>$iconDelete.Yii::t('BackEnd', 'Delete'), 'url'=>'#', 'visible'=>UserAccess::checkAccess('menuItemDelete'), 'linkOptions'=>array('csrf'=>Yii::app()->request->enableCsrfValidation, 'submit'=>array('delete','id'=>$model->id),'confirm'=>Yii::t('BackEnd', 'Are you sure you want to delete this item?'))),
//	array('label'=>Yii::t('BackEnd', 'List menu item'), 'url'=>array('index', 'mId'=>$model->menu_id), 'visible'=>!UserAccess::checkAccess('menuItemAdmin')),
	array('label'=>$iconManager.Yii::t('BackEnd', 'Manage menu item'), 'url'=>array('admin', 'mId'=>$model->menu_id), 'visible'=>UserAccess::checkAccess('menuItemAdmin')),
);

$this->slidebar=array(
	array('label'=>Yii::t('BackEnd','Basic information'), 'name'=>'basic-info', 'rel'=>'menuItem-basic-info'),
);

$this->title = $iconTitle.Yii::t('BackEnd', 'Menu item information').' : '.$model->name;
?>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'name',
        array(
            'name' => 'parent_id',
            'label' => Yii::t('BackEnd', 'Parent item'),
            'value' => MenuItem::model()->findByPk($model->parent_id)->name,
        ),
        array(
            'name' => 'menu_id',
            'value' => Menu::model()->findByPk($model->menu_id)->name,
        ),
		'link:html',
		'description:html',
        array(
            'name' => 'options',
            'value' => $model->options
        ),
		array(
            'name' => 'status',
            'label' => Yii::t('BackEnd', 'Status'),
            'value' => ($model->status==MenuItem::STATUS_ENABLED)?Yii::t('BackEnd', 'Enabled'):Yii::t('BackEnd', 'Disabled'),
        ),
		'sorder',
	),
)); ?>
